using System.Data.Entity;
using SR.SimpleTrack.Models;

namespace SR.SimpleTrack.Data
{
    public class SimpleTrackContext : DbContext
    {
        public DbSet<Project> Projects { get; set; }
        public DbSet<Release> Releases { get; set; }
        public DbSet<ReleaseType> ReleaseTypes { get; set; }
        public DbSet<Status> Statuses { get; set; }
        public DbSet<User> Users { get; set; }
        public DbSet<WorkItem> WorkItems { get; set; }
        public DbSet<WorkItemNote> WorkItemNotes { get; set; }
        public DbSet<WorkLog> WorkLogs { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Entity<Attachment>().Property(a => a.File).HasColumnType("image");
        }
    }
}
